package com.guw.Swing;

import javax.swing.*;
import java.awt.*;

public class TestTextDemo extends JFrame {

    public TestTextDemo(){
        Container container = this.getContentPane();
        //新建文本框
        JTextField jTextField = new JTextField("hello");
        JTextField jTextField2 = new JTextField("world",20);
        //添加到容器中
        container.add(jTextField,BorderLayout.WEST);
        container.add(jTextField2,BorderLayout.EAST);
        //新建密码框
        JPasswordField jPasswordField = new JPasswordField();
        jPasswordField.setEchoChar('*');
        container.add(jPasswordField,BorderLayout.CENTER);





        this.setVisible(true);
        this.setBounds(100,100,600,600);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    }


    public static void main(String[] args) {
        new TestTextDemo();
    }
}
